package org.zcl.listener;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.connection.MessageListener;
import org.springframework.stereotype.Component;

/**
 * .
 *
 * @author zhuchenglin
 * @since 2024/6/22 19:29
 */
@Component
public class MessageQueueListener implements MessageListener {

    @Autowired
    private MessageSubscriber messageSubscriber;

    @Override
    public void onMessage(Message message, byte[] bytes) {
        String s = new String(message.getBody());
        messageSubscriber.handleMessage(s);
    }
}
